/**  
 * All rights Reserved, Designed By www.woniuxy.com
 * @Title:  Account.java   
 * @Package com.woniu.domain   
 * @Description:    Description  
 * @author: 蜗牛学院  
 * @date:   2019年7月30日 下午2:58:43
 * @user:   Administrator  
 * @version V1.0 
 * @Copyright: 2019 www.woniuxy.com Inc. All rights reserved. 
 * 注意：本内容仅限于成都蜗牛创想科技有限公司，禁止外泄以及用于其他的商业目
 */ 
package com.woniu.service.impl;
import java.sql.SQLException;
import java.util.List;

import com.woniu.dao.UserDao;
import com.woniu.dao.impl.UserDaoImpl;
import com.woniu.domain.User;
import com.woniu.domain.UserAddress;
import com.woniu.service.UserService;
/**
 * @author Administrator
 *
 */


public class UserServiceImpl implements UserService {
	private UserDao ud;

	public UserServiceImpl() {
		ud = new UserDaoImpl();
	}

	@Override
	public User UserLogin(String uName, String uPwd) throws SQLException {		
		return ud.findUserByuNameAnduPwd(uName, uPwd);
	}

	@Override
	public boolean checkName(String uName) throws SQLException {
		
		return ud.findUserName(uName) != null;
	}

	@Override
	public boolean saveUser(User user) throws SQLException {
		
		return ud.saveUser(user) > 0;
	}

	@Override
	public List<UserAddress> findUserAddress(User user) throws SQLException {		
		return ud.findUserAddress(user);
	}

	@Override
	public User findAllUser() throws SQLException {
		return ud.findUser();
	}

	@Override
	public void addAddress(String uName, String phoneNum, String province, String city, String county, String street,
			String detail, User user) throws SQLException {
		ud.addAddress(uName, phoneNum, province, city, county, street, detail, user);
		
	}

	
	

}
